using System;
using System.Windows;
using Phoenix.Frames;
using Phoenix.Framework;

namespace Phoenix.ActionResults
{
    public class MessageBoxCallback
    {
        readonly ControllerActionContext context;

        public MessageBoxCallback(MessageBoxResult result, ControllerActionContext context)
        {
            this.context = context;
            Result = result;
        }

        public MessageBoxResult Result { get; set; }

        /// <summary>
        /// Used to invoke Actions on a specific controller type, allowing type safe invocation
        /// </summary>
        /// <typeparam name="TController"></typeparam>
        /// <returns></returns>
        public InvokeActionBuilder<TController> Controller<TController>()
            where TController : Controller
        {
            return new InvokeActionBuilder<TController>(context);
        }

        /// <summary>
        /// Used to invoke Controller Actions
        /// </summary>
        public InvokeActionBuilder InvokeActionBuilder
        {
            get
            {
                return new InvokeActionBuilder(context);
            }
        }
    }
}